package indi.gao;

import com.alibaba.fastjson.JSONObject;
import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
import indi.gao.indi.gao.model.Subject;
import netscape.javascript.JSObject;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Comparator;

/**
 * @author :gaolei
 * @version :v1.0
 * @projectName :GLUtil
 * @description :
 * @createDate :2021/7/30 10:19 上午
 */
public class ListTest {
    public static void main(String[] args) {
        ArrayList<Subject> objects = new ArrayList<>();
        Subject build = Subject.builder().num(1).build();
        Subject build2 = Subject.builder().num(2).build();
        Subject build3 = Subject.builder().num(3).build();
        objects.add(build3);
        objects.add(build);
        objects.add(build2);
        objects.sort(Comparator.comparingInt(Subject::getNum));
        System.out.println(JSONObject.toJSONString(objects));
        objects.sort((o1, o2) -> o2.getNum() - o1.getNum());
        System.out.println(JSONObject.toJSONString(objects));

        Integer a = 2;
        InteTest(a);
        System.out.println(a);
    }

    public static void InteTest(Integer integer) {
        integer++;
    }
}
